<?php

namespace Ue\ErpBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * WorkflowConnection
 *
 * @ORM\Table(name="ue_workflow_connection", indexes={@ORM\Index(name="node_id_idx", columns={"node_id"}), @ORM\Index(name="ue_workflow_connection_next_id_idx", columns={"next_id"})})
 * @ORM\Entity
 */
class WorkflowConnection
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var \WorkflowNode
     *
     * @ORM\ManyToOne(targetEntity="WorkflowNode")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="next_id", referencedColumnName="id")
     * })
     */
    private $next;

    /**
     * @var \WorkflowNode
     *
     * @ORM\ManyToOne(targetEntity="WorkflowNode")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="node_id", referencedColumnName="id")
     * })
     */
    private $node;



    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set next
     *
     * @param \Ue\ErpBundle\Entity\WorkflowNode $next
     * @return WorkflowConnection
     */
    public function setNext(\Ue\ErpBundle\Entity\WorkflowNode $next = null)
    {
        $this->next = $next;

        return $this;
    }

    /**
     * Get next
     *
     * @return \Ue\ErpBundle\Entity\WorkflowNode 
     */
    public function getNext()
    {
        return $this->next;
    }

    /**
     * Set node
     *
     * @param \Ue\ErpBundle\Entity\WorkflowNode $node
     * @return WorkflowConnection
     */
    public function setNode(\Ue\ErpBundle\Entity\WorkflowNode $node = null)
    {
        $this->node = $node;

        return $this;
    }

    /**
     * Get node
     *
     * @return \Ue\ErpBundle\Entity\WorkflowNode 
     */
    public function getNode()
    {
        return $this->node;
    }
}
